package com.zhongfeng.api.modules.business.controller;

import com.zhongfeng.api.modules.business.service.BusinessService;
import com.zhongfeng.api.modules.business.vo.params.BusinessParams;
import com.zhongfeng.api.modules.end.service.EndService;
import com.zhongfeng.api.modules.end.vo.params.EndParams;
import com.zhongfeng.api.modules.utils.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author blueCat
 * @date 2023/2/2 15:45
 * @motto life is a gift
 */
@RestController
@RequestMapping("/api/business")
public class BusinessController {

    @Autowired
    private BusinessService businessService;

    /**
     * 查询全部营销网关
     * @param params
     * @return
     */
    @PostMapping("/queryAllBusiness")
    public Result queryAllBusiness(@RequestBody BusinessParams params) {
        return businessService.queryAllBusiness(params);
    }


    /**
     * 新增营销网关
     * @param params
     * @return
     */
    @PostMapping("/addBusiness")
    public Result addBusiness(@RequestBody BusinessParams params){
        return businessService.addBusiness(params);
    }

    /**
     * 删除营销网关
     * @param params
     * @return
     */
    @PostMapping("/deleteBusiness")
    public Result deleteBusiness(@RequestBody BusinessParams params){
        return businessService.deleteBusiness(params.getId());
    }

    /**
     * 修改营销网关
     * @param params
     * @return
     */
    @PostMapping("/updateBusiness")
    public Result updateBusiness(@RequestBody BusinessParams params){
        return businessService.updateBusiness(params);
    }

}
